package pers.lipeng.snake;

import javax.swing.*;
import java.util.ArrayList;
import java.util.List;

public class HistoryScoreList{
    private static List<Integer> historyScoreList = new ArrayList<>();
    private static JList<Integer> list = new JList<>();

    public static void addScore(int score){
        historyScoreList.add(score);
        list.setListData(historyScoreList.toArray(new Integer[historyScoreList.size()]));
    }

    public static JList<Integer> getInstance(){
        return list;
    }
}
